package com.tencreat.domain.mall;

import com.baomidou.mybatisplus.annotation.*;
import com.tencreat.common.annotation.Excel;
import com.tencreat.common.core.domain.BaseEntity;
import com.tencreat.common.enums.BalanceBusinessType;
import com.tencreat.common.enums.BalanceTypeEnum;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import java.math.BigDecimal;


/**
 * 余额变动对象 balance_change
 *
 * @author wangkai
 * @date 2021-11-15
 */
@Data
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = true)
@AllArgsConstructor
@NoArgsConstructor
@ApiModel
@TableName("balance_change")
public class BalanceChange extends BaseEntity<BalanceChange>{
    private static final long serialVersionUID = 1L;


    /** $column.columnComment */
    @TableId(type = IdType.AUTO)
    @ApiModelProperty(value = "ID")
    private Long id;


    /** 用户uuid */
    @Excel(name = "用户uuid")
    @ApiModelProperty(value= "用户uuid")
    @TableField("`uuid`")
    private Long uuid;

    @Excel(name = "变动前余额")
    @ApiModelProperty(value= "变动前余额")
    @TableField("`balance_before`")
    private BigDecimal balanceBefore;


    /** 变动金额 */
    @Excel(name = "变动金额")
    @ApiModelProperty(value= "变动金额")
    @TableField("`chang_amount`")
    private BigDecimal changAmount;

    /** 剩余余额 */
    @Excel(name = "剩余余额")
    @ApiModelProperty(value= "剩余余额")
    @TableField("`balance`")
    private BigDecimal balance;


    /** 余额类型*/
    @Excel(name = "1 收入,2 支出")
    @ApiModelProperty(value= "1 收入,2 支出")
    @TableField("`type`")
    private String type;


    /** 充值业务类型 */
    @Excel(name = "业务类型")
    @ApiModelProperty(value= "业务类型")
    @TableField("`business_type`")
    private BalanceBusinessType businessType;

    @ApiModelProperty(value= "来源（订单sn）")
    @TableField("`source`")
    private String source;

    @ApiModelProperty(value= "余额类型")
    @TableField("`balance_type`")
    private BalanceTypeEnum balanceType;

    /** 删除标志（0代表存在 2代表删除） */
    @TableLogic
    @TableField("`del_flag`")
    private String delFlag;


    /**
     * 备注
     */
    @Excel(name = "备注")
    @ApiModelProperty(value= "备注")
    @TableField("`remarks`")
    private String remarks;




/** 租户ID */

    @Excel(name = "租户ID")
    @ApiModelProperty(value= "租户ID")
    @TableField("`tenant_id`")
    private Long tenantId;


    @ApiModelProperty(value= "时间搜索")
    @TableField(exist = false)
    private String searchDate;


}
